package com.zp.configuration;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * OSS CORS 闂佹澘绉堕悿鍡樸亜閻у摜绀夐柛娆樺灦閳ь剚淇虹换? application.yaml 閺夆晜绋栭、鎴︽煀瀹ュ洨鏋傞柕??
 */
@Data
@Component
@ConfigurationProperties(prefix = "oss.cors")
public class OssCorsProperties {
    /**
     * 闁稿繋娴囬蹇涙儍閸曨剚闄嶆繝褎鍔х槐娆撳春閻旈攱鍊抽柛鎺擃殙閵嗗啴鏁嶆径娑氱濞撴艾顑呴々褔鏁嶅鈺皌p://localhost:5173, http://127.0.0.1:5173 闁??*
     */
    private List<String> allowedOrigins;
    /**
     * 闁稿繋娴囬蹇涙儍閸曨剚鐓欐繛澶嬫穿缁辩増顪€濡鍚?GET闁靛棔绗璄AD
     */
    private List<String> allowedMethods;
    /**
     * 闁稿繋娴囬蹇涙儍閸曨噮鍤炴慨鐟板€搁妵鏃堟晬濮樺墎甯涢悹??*
     */
    private List<String> allowedHeaders;
    /**
     * 闁哄棙鎸冲﹢鍓佺磼濞嗘劗銈婚悷娆忕墕濞呮帡鎯冮崟顐ｆ儥閹煎瓨鏌ㄩ妵鏃堟晬濮樺墎甯涢悹??ETag
     */
    private List<String> exposeHeaders;
    /**
     * 濡澘瀚ˉ鍛磽閹惧磭鎽犻柡鍐ㄧ埣濡潡鏁嶉崼銏╂健闁挎稑顧€缁辨繃顪€濡鍚?300
     */
    private Integer maxAgeSeconds;
}



